package cn.dlc.com.config;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import cn.dlc.com.property.ZookeeperProperty;

@Configuration
@EnableConfigurationProperties(ZookeeperProperty.class)
public class ConsumerAppConfig {
	
	@Bean
	public ServerProvider serverProvider(ZookeeperProperty zk) throws Exception{
		// 初始化客户端
		ServerProvider sp = new ServerProvider(zk.getUrl(),zk.getNodePath());
		return sp;
	}
}
